package chapter10.practice16;

/**
 * Created by yangliwei on 2017/10/21.
 */
public class UniCycle implements Cycle{

    //一般工厂方法屏蔽该类的构造方法，这里将构造方法设为私有的
    private UniCycle(){}
    @Override
    public void ride() {
        System.out.println("UniCycle ride");
    }

    @Override
    public void sit() {
        System.out.println("UniCycle sit");
    }

    //单例模式，用来做为UniCycle的工厂
    public static CycleFactory cycleFactory = new CycleFactory() {
        @Override
        public Cycle getCycle() {
            return new UniCycle();
        }
    };
}
